package nc.impl.lb.lb_011;

import nc.hr.frame.persistence.IPersistenceDAO;
import nc.hr.frame.persistence.PersistenceDAO;
import nc.itf.hr.frame.PersistenceDbException;
import nc.vo.hr.comp.pf.PFAggVO;
import nc.vo.pub.BusinessException;
import nc.vo.trade.pub.IBillStatus;

public class MyApplyCommit {
	private IPersistenceDAO persistenceDao = new PersistenceDAO();

	public String commitBill(PFAggVO vo) throws BusinessException {

		try {
			persistenceDao.executeNoResultSQL(null,
					"update wa_tm_apply_main set states=" + IBillStatus.COMMIT
							+ ", applydate = '"
							+ vo.getParentVO().getAttributeValue("applydate")
							+ "' where pk_tm_apply_main='"
							+ vo.getParentVO().getPrimaryKey() + "'");
		
		} catch (PersistenceDbException e) {
			throw new BusinessException(e);
		}
		return vo.getParentVO().getPrimaryKey();
	}
}
